package ModelLayer;

import java.util.Date;

public class Sale {
	private int id;
	private Guest guest;
	private Employee employee;
	private KeyWord payStatus;
	private Date createDate;
	private Date payDate;
	private KeyWord payMethod;
	private double totalPrice;

	private RoomBooking roomBooking; // contains all room booking lines, related
										// fields and methods
	private ActivityBooking activityBooking; // contains all the activity
												// bookings, related fields and
												// methods

	public Sale(int id) {
		this.id = id;
	}

	public Sale() {
	}

	public void getTotalPriceWithDiscount() {
		// TODO need to add activity total price
		setTotalPrice(roomBooking.getRent() * getDiscount());
	}

	public double getDiscount() {
		double discount = 1;
		if (getGuest().getAgency() != null) {
			discount = getGuest().getAgency().getDiscountGroup().getDiscount();
		} else {
			discount = getGuest().getDiscountGroup().getDiscount();
		}
		return discount;
	}

	public int getId() {
		return id;
	}

	public void setId(int iD) {
		id = iD;
	}

	public Guest getGuest() {
		return guest;
	}

	public void setGuest(Guest guest) {
		this.guest = guest;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	public KeyWord getPayStatus() {
		return payStatus;
	}

	public void setPayStatus(KeyWord payStatus) {
		this.payStatus = payStatus;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getPayDate() {
		return payDate;
	}

	public void setPayDate(Date payDate) {
		this.payDate = payDate;
	}

	public KeyWord getPayMethod() {
		return payMethod;
	}

	public void setPayMethod(KeyWord payMethod) {
		this.payMethod = payMethod;
	}

	public double getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(double totalPrice) {
		this.totalPrice = totalPrice;
	}

	public RoomBooking getRoomBooking() {
		return roomBooking;
	}

	public void setRoomBooking(RoomBooking roomBooking) {
		this.roomBooking = roomBooking;
	}

	public ActivityBooking getActivityBooking() {
		return activityBooking;
	}

	public void setActivityBooking(ActivityBooking activityBooking) {
		this.activityBooking = activityBooking;
	}

}
